package test3;

public class test {
    public static void main(String[] args)
    {
        int n = 100000;
        int count = 0;
        long start = System.currentTimeMillis();
        for(int i = 2;i <= n;i++)
        {
            boolean flag = true;
            //for(int j = 2;j < i;j++)
            for(int j = 2;j <= Math.sqrt(i);j++)
            {
                if(i % j == 0)
                {
                    flag = false;
                    break;
                }
            }
            if(flag == true)
            {
                count++;
            }
        }
        long end = System.currentTimeMillis();
        System.out.println(count);
        System.out.println(end - start + "ms");
    }
}
